<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>知识库</title>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>代码生成器</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="../js/vuejs-2.5.16.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
</head>
<body class="hold-transition skin-red sidebar-mini">
<div id="app">
    <div class="box-header with-border">
        <h1 class="box-title">代码生成器</h1>
    </div>

    <!--输入表单-->
    <div class="box-body" style="font-size: 20px">
        <form class="form-horizontal">
            <!--pojo-->
            <div class="form-group">
                <label for="pojo" class="col-sm-2 control-label">实体类pojo:</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="pojo" id="pojo" v-model="pojo">
                </div>
            </div>
            <!--service-->
            <div class="form-group">
                <label for="service" class="col-sm-2 control-label">业务类service:</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="service" id="service" v-model="service">
                </div>
            </div>
            <!--controller-->
            <div class="form-group">
                <label for="controller" class="col-sm-2 control-label">控制器类controller:</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="controller" id="controller"
                           v-model="controller">
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <!--<button type="submit" @click.prevent="genCode()" class="btn btn-default">生成</button>-->
                    <button type="submit" @click.prevent="genCode()" class="btn btn-default">生成</button>
                </div>
            </div>
        </form>

    </div>

    <div v-show="temp">
        <div style="margin-left: 150px">
            <a class="btn btn-info down" :href="downMapper+temp">Mapper</a>
            <a class="btn btn-info down" :href="downService+temp">Service</a>
            <a class="btn btn-info down" :href="downImpl+temp">ServiceImpl</a>
            <a class="btn btn-info down" :href="downController+temp">Controller</a>
            <br/>
        </div>
    </div>
</div>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            pojo: "com.**.pojo.Tb**",
            service: "com.**.service.**Service",
            controller: "com.**.controller.**Controller",
            temp: "",
            downMapper: "../gen/mapper.do",
            downService: "../gen/service.do",
            downImpl: "../gen/impl.do",
            downController: "../gen/controller.do"
        },
        methods: {
            genCode: function () {
                this.temp = "?pojo=" + this.pojo + "&service=" + this.service + "&controller=" + this.controller;
            }
        }
    });



</script>
</body>
</html>